﻿<%@ Control Language="C#" Inherits="Forum.Business.MyThreadList, Forum.Business" AutoEventWireup="true" %>
<%@ Import Namespace="Forum.Business" %>

<script runat="server" type="text/C#">
    private string GetThreadStatus(Thread thread)
    {
        if (thread.ThreadStatus.Value == 0)
        {
            return "PrefixCol List";
        }
        else if (thread.ThreadStatus.Value == 1)
        {
            return "PrefixCol Jian";
        }
        else if (thread.ThreadStatus.Value == 2)
        {
            return "PrefixCol Ding";
        }
        else if (thread.ThreadStatus.Value == 3)
        {
            return "PrefixCol Jing";
        }
        return "PrefixCol List";
    }
</script>

<fieldset>
    <legend>我发表的帖子</legend>

    <asp:Repeater id="list" runat="server">
        <HeaderTemplate>
            <table border="0" cellpadding="0" cellspacing="0" class="AdminTable">
                <thead>
                    <tr>
                        <th class="TitleCol">标题</th>
                        <th class="IsRecommendedCol">帖子状态</th>
                        <th class="MarksCol">帖子分数</th>
                        <th class="CountCol">回复总数</th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td class="TitleCol">
                    <a target="_blank" href="<%# SiteUrls.Instance.GetThreadUrl(((Thread)Container.DataItem).EntityId.Value) %>"><%# ((Thread)Container.DataItem).Subject.Value%></a>
                </td>
                <td class='<%# GetThreadStatus((Thread)Container.DataItem) %>'>&nbsp;
                </td>
                <td class="MarksCol">
                    <%# ((Thread)Container.DataItem).ThreadMarks.Value%>
                </td>
                <td class="CountCol">
                    <%# ((Thread)Container.DataItem).TotalPosts.Value%>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
                </tbody>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <div class="PagingWrapper">
        <asp:Panel Runat="server" align="right" CssClass="CommonPagingArea">
            <ctrl:CurrentPage Cssclass="columnText" id="currentPage" runat="server" />
            <ctrl:Pager id="pager" runat="server" PageSize="50" />
        </asp:Panel>
    </div>
</fieldset>